using System;
using System.Configuration;
using System.Data;
using System.Data.OleDb;
using Evaluation3.interfaces;
using Evaluation3.data;
using Evaluation3.utils;
namespace Evaluation3.classes
{
	/// <summary>
	/// Summary description for companyClass.
	/// </summary>
	public class companyClass : companyIMP
	{
        private string name;
        private string id;
        private string description;
        private string year;
        private string address;
        private string mail;
        private string phone;
        private string site;
        private string demoSite;
        private string infomation;

        private DoanhNghiep objDoanhnghiep;
        private OleDbConnection myConnection;

        public companyClass(string iid)
        {

            myConnection = dataUtils.GETOLEDBCONNECTION();
            myConnection.Open();

            objDoanhnghiep = new DoanhNghiep();
            objDoanhnghiep.ActiveConnection = myConnection;
            objDoanhnghiep.SelectCondition = "madoanhnghiep=" + iid;
            objDoanhnghiep.LoadData();
            //objDoanhnghiep.Rows[0];


            Id = objDoanhnghiep.Rows[0][DoanhNghiep.MaDoanhNghiep].ToString();
            Name = objDoanhnghiep.Rows[0][DoanhNghiep.TenDoanhNghiep].ToString();

            Description = objDoanhnghiep.Rows[0][DoanhNghiep.ChucNang].ToString();
            Year = objDoanhnghiep.Rows[0][DoanhNghiep.NamThanhLap].ToString();
            Address = objDoanhnghiep.Rows[0][DoanhNghiep.DiaChi].ToString();
            Mail = objDoanhnghiep.Rows[0][DoanhNghiep.Email].ToString();
            Phone = objDoanhnghiep.Rows[0][DoanhNghiep.SoDienThoai_Fax].ToString();
            Site = objDoanhnghiep.Rows[0][DoanhNghiep.WebSite].ToString();
            DemoSite = objDoanhnghiep.Rows[0][DoanhNghiep.http].ToString();
            Infomation = objDoanhnghiep.Rows[0][DoanhNghiep.Info].ToString();
        }
        public string Name {
            get { return name; }
            set { name = value; } 
        }
        public string Id {
            get { return id; }
            set { id = value; } 
        }
        public string Description
        {
            get { return description; }
            set { description = value; }
        }
        public string Year
        {
            get { return year; }
            set { year = value; }
        }
        public string Address
        {
            get { return address; }
            set { address = value; }
        }
        public string Mail
        {
            get { return mail; }
            set { mail = value; }
        }
        public string Phone
        {
            get { return phone; }
            set { phone = value; }
        }
        public string Site
        {
            get { return site; }
            set { site = value; }
        }
        public string DemoSite
        {
            get { return demoSite; }
            set { demoSite = value; }
        }
        public string Infomation
        {
            get { return infomation; }
            set { infomation = value; }
        }

        public string getName() { return Name; }
        public string getId() { return Id; }
        public string getDescription() { return Description; }
        public string getYear() { return Year; }
        public string getAddress() { return Address; }
        public string getMail() { return Mail; }
        public string getPhone() { return Phone; }
        public string getSite() { return Site; }
        public string getDemoSite() { return DemoSite; }
        public string getInfomation() { return Infomation; }
	}
}
